package com.j.lemon.learn.designpattern.visitor;


import com.j.lemon.learn.designpattern.visitor.impl.Computer;
import com.j.lemon.learn.designpattern.visitor.impl.Keyboard;
import com.j.lemon.learn.designpattern.visitor.impl.Monitor;
import com.j.lemon.learn.designpattern.visitor.impl.Mouse;

/**
 * 4. 创建实现了 ComputerPartVisitor 的实体访问者。
 */
public class ComputerPartDisplayVisitor implements ComputerPartVisitor {

    @Override
    public void visit(Computer computer) {
        System.out.println("Displaying Computer.");
    }

    @Override
    public void visit(Mouse mouse) {
        System.out.println("Displaying Mouse.");
    }

    @Override
    public void visit(Keyboard keyboard) {
        System.out.println("Displaying Keyboard.");
    }

    @Override
    public void visit(Monitor monitor) {
        System.out.println("Displaying Monitor.");
    }
}
